Modern hard disc drives comprise one or more rigid discs that are coated with a magnetizable medium and mounted on a hub of a spindle motor for rotation at a constant high speed about a rotational axis. Information is stored on one or more surfaces of the disc or discs in a plurality of concentric circular tracks. Data is written to, and/or read from, sectors on the tracks via transducers (“heads”) mounted to a radial actuator that positions the heads relative to the discs. The read and write elements are typically positioned over specific sectors of the disc in accordance with read and write commands, respectively, received from a host connected to the disc drive. These commands, as well as their associated data, are transferred between the disc drive and the host via a communication interface, such as, for example, various versions of the Advanced Technology Attachment (ATA) interface or the Small Computer Systems Interface (SCSI) interface.
One of the primary performance characteristics of a disc drive is overall data transfer rate of the drive. The overall data transfer rate of the disc drive generally includes two main components, the external data transfer rate and the internal data transfer rate. The external data transfer rate, sometimes referred to as the interface, host, or burst transfer rate, relates to the speed at which data can be transferred between the disc drive and the host. The internal data transfer rate, sometimes referred to as the sustained transfer rate, relates to the speed at which a disc drive can read and write data to and from the tracks, once that data has been received or requested from the host. The internal data transfer rate typically includes the time required for the disc drive to process the read or write command, as well as the time required to move the transducer to the appropriate track to read or write the data.
While the internal and external data transfer rates of a disc drive are defined separately, they are often interrelated. For example, in accordance with many communication interface specifications, after sending a command to a disc drive, the host must wait for the disc drive to respond that the command has been serviced before the host may issue another command. That is, the host must wait for the data it requested until it can request more data. As such, the external transfer rate of the disc drive is limited, to some extent, by the time required by the disc drive to service commands. As will be appreciated, the time required by the disc drive to service the commands is primarily related to the internal data transfer rate.
A common way to increase both the internal and external data transfer rates involves providing some sort of disc caching mechanism in the disc drive to temporarily store data that is being written to or retrieved from the disc drive. Disc caching typically involves using a fast solid state memory in the disc drive as a buffer for data transferred between the disc drive and the host.
In accordance with one embodiment, a method for managing read commands and disc write operations in a disc drive is contemplated. In accordance with this embodiment, if the disc drive receives a read command from the host (or other some other computer process external to the disc drive) while the disc drive is conducting a disc write operation, then the disc write operation is discontinued to service the read command. By discontinuing the disc write operation to service the read command, the internal and/or external data transfer rates of the disc drive may be improved.
In disc drives employing write caching, when a host sends a write command to the disc drive, the data is immediately stored in the write cache for later writing to the disc. The disc drive then immediately informs the host that the data has been written to the disc. By informing the host immediately that the data has been written, rather than waiting until the data is actually written to the disc, the host is freed to prepare and send other read or write commands and/or to perform other data transfer functions, thus speeding up the external transfer rate of the disc drive.
In addition to speeding up the external transfer rate, the write cache may also be used to speed up the internal transfer rate of the disc drive. For example, in a process known as write coalescing, data received at the disc drive, in accordance with various write command from a host, is first stored in the write cache and then examined to locate blocks of data that are to be written to the disc in contiguous data blocks. That is, contiguous data blocks are blocks of data that have contiguous logical block addresses or blocks of data that can be written to the disc in a single disc write operation. Once located, these contiguous data blocks are then combined or coalesced and written to the disc in a single disc write operation. By writing this data in a single disc write operation, rather than a number of individual write operations, the internal data transfer rate of the disc drive may be improved.
Additionally, a write cache may also be used as a temporary buffer for future read operations. For example, when a command is received from the host to read a particular block of data, the write cache may first be searched to determine if the requested data is still present in the write cache. If the data is still present, the data can be then be sent back to the disc drive directly from the write cache, without requiring the disc drive to spend additional time accessing the disc for the data.
In disc drives employing read caching, data that is read from the discs of the disc drive in response to a read command from the host, is stored in the read cache before it is sent off to the host. Additionally, read caching may also involve storing “extra” data, sometimes referred to as look-ahead data, that was not requested by the host in the read command, but which is located on the same track as the requested data on the disc drive. This is done because hosts tend to request data from the disc drive in a sequential or predictably ordered manner. As such, when the host sends the next read command, it is likely that at least part of the data requested will have been read into the cache in the look-ahead operation. Again, since data retrieval from the read cache is typically several thousand times faster than data retrieval from the disc, data transfer rates can be greatly increased by using the read caching.
As described, in a typical disc drive employing data caching, when a read command arrives at the disc drive, the disc drive first checks to see whether the requested data is in the read and/or write cache. If the read and/or write cache contains the data, the requested data is sent immediately to the host from the cache. If, however, the cache does not contain the requested data, the drive must retrieve the requested data from the discs. If the disc drive is currently busy, such as performing a write operation, the disc drive, and thus the host, must wait until the write operation is complete before retrieving the requested data from the disc. In this situation, disc caching does nothing to speed up the retrieval of the requested information from the disc (internal data transfer rate) or the transmission of the data back to the host (external transfer rate). As such, both the internal and external data transfer rates of the disc drive will suffer. This situation is made worse when a number of write commands have been combined or coalesced into one long disc write operation, thus increasing the time for the disc write operation to complete.
As such, there is a need in the art for systems and/or methods that allow for the fast servicing of read-commands, even in situations where a lengthy disc write operation is being carried out in the disc drive. It is against this backdrop that the present invention has been developed.